﻿<phone:PhoneApplicationPage 
    x:Class="webslice.PreviewPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
      xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <Style TargetType="ContentControl" x:Key="HintCustomStyle">
            <Setter Property="Foreground" Value="Gray"/>
        </Style>

        <DataTemplate x:Key="HeaderTemplate">
            <TextBlock Text="Image(Tap to choose)" FontSize="24" Foreground="Gray"></TextBlock>
        </DataTemplate>
        <DataTemplate x:Key="ListTemplate">
           
            <StackPanel Orientation="Horizontal" Width="480" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Center">

                <Image x:Name="productImage"  Source="{Binding}"  Height="180" Width="180"  VerticalAlignment="Center" HorizontalAlignment="Center" Tag="{Binding}" Tap="productImage_Tap_1">
                </Image>
               
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="{StaticResource bipivot}" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,0">
            <Image x:Name="imgLogo"  Style="{StaticResource PivotTitle}"  Margin="10,0,0,0"/>
            <TextBlock x:Name="tblkVideosTitle"  Text="Create Web Tile" Foreground="Gray"  Style="{StaticResource DetailPagePivotTitle}"/>
        </StackPanel>
        <Grid x:Name="ContentPanel"  Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="1" Orientation="Horizontal" >
                <TextBlock Margin="10,15,0,0" Text="Title:" Foreground="Gray"  FontSize="22" Height="40" Width="150"></TextBlock>
              
                   
                    <TextBox BorderBrush="Gray" Foreground="Gray" x:Name="TbItem" TextChanged="TbItem_TextChanged_1" Height="70" Width="225" ></TextBox>
                <TextBlock HorizontalAlignment="Right" Height="40" Visibility="Collapsed" x:Name="TbVal" Text="*mandatory" FontSize="18" Foreground="Red"></TextBlock>
            </StackPanel>
            
            <StackPanel Grid.Row="2" Orientation="Horizontal" >
                <TextBlock Margin="10,10,0,0" Foreground="Gray" Text="Site Name:" TextWrapping="Wrap" FontSize="22"  Height="30" Width="150"></TextBlock>
                <TextBox x:Name="Tbsite"  Height="70" Width="225" BorderBrush="Gray" Foreground="Gray"></TextBox>
            </StackPanel>
            <StackPanel Grid.Row="0" Orientation="Horizontal" >
                <TextBlock Margin="10,20,0,0" FontSize="22" Foreground="Gray" Text="Data Type" TextWrapping="Wrap"   Height="40" Width="150"></TextBlock>
                    <toolkit:ListPicker BorderBrush="Gray" x:Name="ModeList" Width="200" Foreground="Gray" FontSize="22" SelectionChanged="ModeList_SelectionChanged_1">
                    </toolkit:ListPicker>
                <TextBlock Height="40" Visibility="Collapsed" x:Name="listVal"  HorizontalAlignment="Right" Text="*mandatory" FontSize="18" Foreground="Red"></TextBlock>
            </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Row="3">
                    <StackPanel Orientation="Vertical">
                        <TextBlock x:Name="urlval" Text="Enter Url" FontSize="15" Foreground="Red" Visibility="Collapsed" HorizontalAlignment="Right"></TextBlock>
                        <toolkit:PhoneTextBox  LengthIndicatorVisible="False"  Foreground="Gray" BorderBrush="Gray" Height="70" Width="390"   x:Name="UrlText" Hint="Url" HintStyle="{StaticResource HintCustomStyle}"></toolkit:PhoneTextBox>
                    </StackPanel>
                    <Button Content="go" Height="75" Width="80" Foreground="Gray" BorderBrush="Gray" ClickMode="Press" Click="Button_Click" Margin="0,0,0,0"></Button>
            </StackPanel>
            <toolkit:ListPicker BorderBrush="Gray" Foreground="Gray" Grid.Row="4" HorizontalAlignment="Left" x:Name="Imagelist" Margin="10,-20,0,10" Visibility="visible"
               Height="100" Width="365"  
              FullModeHeader="Create Web Tile Image"  AllowDrop="False" ExpansionMode="FullScreenOnly"  HeaderTemplate="{StaticResource HeaderTemplate}"     
              ItemsSource="{Binding}" FullModeItemTemplate="{StaticResource ListTemplate}" />
            <StackPanel Orientation="Horizontal" Grid.Row="5">
            <StackPanel Grid.Row="6" Orientation="Horizontal">
                    <TextBlock Text="Preview:" FontSize="22" Foreground="Gray" Margin="10,0,0,0"></TextBlock>
                    <Canvas Width="130" Height="190" Margin="30,0,0,0" VerticalAlignment="Top">
                        <Canvas x:Name="PreviewCan"  Width="130" Visibility="Visible" Background="LightGray" Height="190">
                        <TextBlock x:Name="previewTb" Foreground="Gray"  Canvas.Top="-5" Width="120" TextTrimming="WordEllipsis" Margin="10,0,0,0" FontSize="24"></TextBlock>
                        <Image Height="128" Width="128" Source="/Images/Preview.png" Canvas.Top="32"></Image>
                            <TextBlock x:Name="PreviewSTB" Foreground="Gray" Height="30" Width="115" TextTrimming="WordEllipsis" Margin="10,0,0,0" FontSize="22" Canvas.Top="160"></TextBlock>
                    </Canvas>
                        <Image x:Name="ProductImage"  Width="130" Height="190" Visibility="Collapsed"    VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0,0,0">
                            </Image>
                    </Canvas>
                </StackPanel>
            <Button Content="Save" Foreground="Gray" BorderBrush="Gray" x:Name="btndone" IsEnabled="False" VerticalAlignment="Center" HorizontalAlignment="Center" Height="80" Width="150" Margin="60,0,0,50"  Click="btnDone_Click"></Button>
            </StackPanel>
        </Grid>
    </Grid>
  
</phone:PhoneApplicationPage>
